Using php to generate thumbnails (convert text into images) is an out-of-the-box classic php to generate thumbnails. Files are flexible and practical and can generate images of any style, you can also convert text into images.
Php tutorial to
PHP generated thumbnails (text converted to graphics) This is a version of the classic PHP generated thumbnail class function, the file is flexible and practical, can generate any style of the picture, and can convert the text into graphics.
PHP
01. php
/*
Drawing with Windows graphic Board
1: Create a canvas and set the size.
2: Create a pigment. (red, r Green G blue B, composed of three primary colors. The primary colors can be 0-from weak to strong ).
3: draw lines, write, draw
Php image application-generate an image with a watermark text-generate an image with a watermark icon-generate a thumbnail (// For the annotation content, without affecting File Execution ),//// // Start of the watermark text function ///////////////
////////////////Defining the watermark Text function begins//////////////////function Watertext ($i, $t = ' All rights reserved ', $s =20, $c = ' white ', $p =9) {$img = Imagecreatefromjpeg ($i); Imagecreatefromjpeg-creates a new image from a file
Often there is the need to generate promotional posters, including the specified QR code, to share someone else to scan the code to determine the user referral relationship.Careful analysis, the necessary elements of the promotion poster is the
This article mainly describes how to implement the PHP code processing pictures, interested in the reference of friends, I hope to be helpful to everyone.
First, the image scaling code
Non-proportional picture scaling code
$fileNames =
I have a function to stitch two pictures below is my Code
$im = imagecreatefrompng("images/err.png"); $stamp = imagecreatefrompng('images/default.png'); $test = imagecreate(imagesx($stamp)+imagesx($im),imagesy($im)); $orange =
Verification code function (personal understanding):
Reduce the pressure on the server (such as the 12306 verification code function);
Prevention of violent registration
Personal idea: generate N-bit random numbers in a-z,a-z,1-9
Note: If you want to use PHP GD processing we need to open the GD library
GD Library support for PHP under Windows
Find php.ini, open content, find:
; Extension=php_gd2.dll
Put the front semicolon ";" Remove, then save, if there is no semicolon,
Long micro-blog image generation (can contain pictures, preliminary settings only allow the first two pictures, and this method of image typesetting more trouble, so set two pictures)Simple text generation picture is simple, but if you need rich
Ob_clean ();Header (' content-type:image/png ');If you have a problem and need to find a bug, put the header last/*$str = "1\n2\n3\n";$im = Imagecreate (100,120);$white = Imagecolorallocate ($im, 0xff,0xff,0xff);Imagecolortransparent ($im, $white);
HP QR code is a php two-dimensional code generation class library, it can easily generate two-dimensional code, the official website provides a download and a number of demo demos, to see the address:http://phpqrcode.sourceforge.net/After
HP QR code is a php two-dimensional code generation class library, it can easily generate two-dimensional code, the official website provides a download and a number of demo demos, to see the address:http://phpqrcode.sourceforge.net/ After
Php image function example (not original ). The following is a method: if (! Function_exists (imagecreate) {die (this server does not support the GD module);} if not, how can I configure it? Download the dll file of the gd module and modify the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.